3.25 \(\int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=68 \[ -\frac{a^2 \cos (c+d x)}{d}-\frac{2 a b \sin (c+d x)}{d}+\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac{b^2 \cos (c+d x)}{d}+\frac{b^2 \sec (c+d x)}{d} \]

[Out]

(2*a*b*ArcTanh[Sin[c + d*x]])/d - (a^2*Cos[c + d*x])/d + (b^2*Cos[c + d*x])/d + (b^2*Sec[c + d*x])/d - (2*a*b*
Sin[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0736639, antiderivative size = 68, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.368, Rules used = {3517, 2638, 2592, 321, 206, 2590, 14} \[ -\frac{a^2 \cos (c+d x)}{d}-\frac{2 a b \sin (c+d x)}{d}+\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac{b^2 \cos (c+d x)}{d}+\frac{b^2 \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]*(a + b*Tan[c + d*x])^2,x]

[Out]

(2*a*b*ArcTanh[Sin[c + d*x]])/d - (a^2*Cos[c + d*x])/d + (b^2*Cos[c + d*x])/d + (b^2*Sec[c + d*x])/d - (2*a*b*
Sin[c + d*x])/d

Rule 3517

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[Expand[Sin[e
+ f*x]^m*(a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2590

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> -Dist[f^(-1), Subst[Int[(1 - x^2
)^((m + n - 1)/2)/x^n, x], x, Cos[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n - 1)/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \sin (c+d x) (a+b \tan (c+d x))^2 \, dx &=\int \left (a^2 \sin (c+d x)+2 a b \sin (c+d x) \tan (c+d x)+b^2 \sin (c+d x) \tan ^2(c+d x)\right ) \, dx\\ &=a^2 \int \sin (c+d x) \, dx+(2 a b) \int \sin (c+d x) \tan (c+d x) \, dx+b^2 \int \sin (c+d x) \tan ^2(c+d x) \, dx\\ &=-\frac{a^2 \cos (c+d x)}{d}+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}-\frac{b^2 \operatorname{Subst}\left (\int \frac{1-x^2}{x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac{a^2 \cos (c+d x)}{d}-\frac{2 a b \sin (c+d x)}{d}+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}-\frac{b^2 \operatorname{Subst}\left (\int \left (-1+\frac{1}{x^2}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}-\frac{a^2 \cos (c+d x)}{d}+\frac{b^2 \cos (c+d x)}{d}+\frac{b^2 \sec (c+d x)}{d}-\frac{2 a b \sin (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.439056, size = 111, normalized size = 1.63 \[ -\frac{\sec (c+d x) \left (\left (a^2-b^2\right ) \cos (2 (c+d x))+a^2+2 a b \sin (2 (c+d x))+4 a b \cos (c+d x) \left (\log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )\right )-3 b^2\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]*(a + b*Tan[c + d*x])^2,x]

[Out]

-(Sec[c + d*x]*(a^2 - 3*b^2 + (a^2 - b^2)*Cos[2*(c + d*x)] + 4*a*b*Cos[c + d*x]*(Log[Cos[(c + d*x)/2] - Sin[(c
 + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + 2*a*b*Sin[2*(c + d*x)]))/(2*d)

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 108, normalized size = 1.6 \begin{align*}{\frac{{b}^{2} \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{d\cos \left ( dx+c \right ) }}+{\frac{{b}^{2}\cos \left ( dx+c \right ) \left ( \sin \left ( dx+c \right ) \right ) ^{2}}{d}}+2\,{\frac{{b}^{2}\cos \left ( dx+c \right ) }{d}}-2\,{\frac{ab\sin \left ( dx+c \right ) }{d}}+2\,{\frac{ab\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-{\frac{{a}^{2}\cos \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)*(a+b*tan(d*x+c))^2,x)

[Out]

1/d*b^2*sin(d*x+c)^4/cos(d*x+c)+1/d*b^2*cos(d*x+c)*sin(d*x+c)^2+2*b^2*cos(d*x+c)/d-2*a*b*sin(d*x+c)/d+2/d*a*b*
ln(sec(d*x+c)+tan(d*x+c))-a^2*cos(d*x+c)/d

________________________________________________________________________________________

Maxima [A]  time = 1.11944, size = 90, normalized size = 1.32 \begin{align*} \frac{b^{2}{\left (\frac{1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} + a b{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )} - a^{2} \cos \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

(b^2*(1/cos(d*x + c) + cos(d*x + c)) + a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1) - 2*sin(d*x + c)) -
a^2*cos(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 2.32235, size = 230, normalized size = 3.38 \begin{align*} \frac{a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) -{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}{d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

(a*b*cos(d*x + c)*log(sin(d*x + c) + 1) - a*b*cos(d*x + c)*log(-sin(d*x + c) + 1) - 2*a*b*cos(d*x + c)*sin(d*x
 + c) - (a^2 - b^2)*cos(d*x + c)^2 + b^2)/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right )^{2} \sin{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))**2,x)

[Out]

Integral((a + b*tan(c + d*x))**2*sin(c + d*x), x)

________________________________________________________________________________________

Giac [B]  time = 4.53757, size = 3830, normalized size = 56.32 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-(a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*t
an(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2
+ 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1))*tan(1/2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